/**
 * Created with IntelliJ IDEA.
 * User: skyline{http://my.oschina.net/skyline520}
 * Date: 12-11-23
 * Time: 下午3:30
 * To change this template use File | Settings | File Templates.
 */
Ext.define('Airways.view.system.roleoperation.RoleQueryFormPanel',{
    extend:'Ext.form.Panel',
    alias:'widget.roleOperationRoleQueryFormPanel',
    name:'queryFormPanel',
    anchor:'100% 20%',
    header:false,
    bodyBorder:false,
    bodyStyle:'padding:20px 10px 0 10px',
    frame:true,
    defaults:{
        xtype:'textfield',
        labelAlign:'right',
        labelWidth:70,
        width:170
    },
    buttonAlign:'center',
    layout:{
        type:'table',
        columns:3
    },
    initComponent:function (){
        Ext.apply(this,{
            buttons:[{
                text:'查询',
                action:'query',
                iconCls:'search'
            }]
        }),
        this.items = this.buildItems();
        this.callParent(arguments);
    },
    buildItems:function(){
        var statusStore = Ext.create('Ext.data.Store',{
            model:'comboxModel',
            data:[{key:'',value:'全部'},{key:'1',value:'启用'},{key:'0',value:'禁用'}],
            autoLoad:true,
            listeners:{
                load:function(){
                }
            }
        });
        var status = Ext.create('Ext.form.ComboBox',{
            name:'status',
            labelAlign:'right',
            fieldLabel:'状态',
            store:statusStore,
            queryMode:'local',
            displayField:'value',
            valueField:'key'
        });
        return [{
            name:'roleNo',
            fieldLabel:'角色编码'
        },{
            name:'roleName',
            fieldLabel:'角色名称'
        },status]
    }
});
